package com.wbs.domain.repository;

import java.io.Serializable;
import java.util.List;
import java.util.Map;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.NoRepositoryBean;

import com.wbs.domain.BaseEntity;

@NoRepositoryBean
public interface BaseRepository<T, ID extends Serializable> extends JpaRepository<T, ID> {
    T findSingleObject(String queryString, Object... params);
    List<Map<String, Object>> executeNativeQuery(String queryString, Integer startPosition, Integer maxResult, String[] resultFields, Object... params);
    int executeNativeQuery(String queryString, Object... params);
    List<T> executeQuery(String queryString, Integer startPosition,    Integer maxResult, Object... params);
    List<T> executeListQuery(String queryString, Integer startPosition,    Integer maxResult, Map<String,Object> params);
    Map<String, Object> createParameterizedQueryString(String entityName, String propertyName, Map<String, Object> attr);
    Map<String, Object> createQueryString(String entityName, String propertyName, Map<String, Object> attr);
    Long executeCountQuery(String queryString, Integer startPosition,Integer maxResult, Map<String,Object> params);
    public <E extends BaseEntity> E saveEntity(E entity);
    public <E extends BaseEntity> List<E> saveEntities(Iterable<E> entities);
    public <E extends BaseEntity> E find(Class<E> classType,Serializable id);
    public <E extends BaseEntity> List<E> findAll(Class<E> classType);
}